<template>
  <div style="width: 80%;margin: 5% auto ;">
    <el-table
      border
      stripe
      :data="projectList"
      v-loading="loading">
      <el-table-column label="项目名称" align="center" prop="name" />
      <el-table-column width="400" label="项目进度" align="center" prop="process">
        <template slot-scope="scope">
          <el-progress :text-inside="true" :stroke-width="26" :percentage="scope.row.process"></el-progress>
        </template>
      </el-table-column>
    </el-table>
  </div>

</template>

<script>
import { listProject } from '@/api/system/project'
import { getToken } from '@/utils/auth'

export default {
  name: "Index",
  data() {
    return {
      // 版本号
      version: "3.8.6",
      // 遮罩层
      loading: true,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        detailFileUrl: null,
        time: null,
        process: null
      },
      // 表格数据
      projectList: [],
      // 总条数
      total: 0,
    };
  },
  created() {
    this.getList();
  },
  computed: {
    headers() {
      const authorization = getToken() || ''
      return { authorization }
    }
  },
  methods: {
    /** 查询项目列表 */
    getList() {
      this.loading = true;
      listProject(this.queryParams).then(response => {
        this.projectList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    goTarget(href) {
      window.open(href, "_blank");
    }
  }
};
</script>

<style scoped lang="scss">

</style>

